//
//  ChooseGift.m
//  ChooseGift
//
//  Created by lanou on 15/12/16.
//  Copyright (c) 2015年 lanou. All rights reserved.
//

#import "ChooseGift.h"

@implementation ChooseGift
-(void)setValue:(id)value forKey:(NSString *)key{
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"description"]) {
        self.descriptionnew = value;
        
    }
    if ([key isEqualToString:@"id"]) {
        self.ID = value;
        
    }
    if ([key isEqualToString:@"favorites_count"]) {
        self.favorites_count = [value stringValue];
    }
    
    
}


- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
}



//@property (nonatomic,copy) NSString *cover_image_url;
//
//@property (nonatomic,copy) NSString *descriptionnew;
//
//@property (nonatomic,copy) NSString *ID;
//
//@property (nonatomic,copy) NSString *name;
//
//@property (nonatomic,copy) NSString *price;
//
//@property (nonatomic,copy) NSString *favorites_count;



- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:_cover_image_url forKey:@"title"];
    [aCoder encodeObject:_descriptionnew forKey:@"begin_time"];
    [aCoder encodeObject:_ID forKey:@"end_time"];
    [aCoder encodeObject:_name forKey:@"address"];
    [aCoder encodeObject:_price forKey:@"category_name"];
    [aCoder encodeObject:_favorites_count forKey:@"participant_count"];
    
    
}



- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self) {
        
        self.cover_image_url = [aDecoder decodeObjectForKey:@"title"];
        self.descriptionnew = [aDecoder decodeObjectForKey:@"begin_time"];
        self.ID = [aDecoder decodeObjectForKey:@"end_time"];
        self.name = [aDecoder decodeObjectForKey:@"address"];
        self.price = [aDecoder decodeObjectForKey:@"category_name"];
        self.favorites_count = [aDecoder decodeObjectForKey:@"participant_count"];
        
    }
    return self;
}

























@end
